<?php defined('SYSPATH') or die('No direct script access.');

class Model_Order extends ORM
{  
    protected $_reload_on_wakeup = false;

    public function get_all_user_cashback_orders()
    {
        $user = Model_Auth::instance()->get_user();
        if (!$user) {
            return array();
        }
             
        $orders = ORM::factory('order')
                    ->where('cashback_id', '=', $user->id)
                    ->order_by('action_date', 'DESC')
                    ->find_all()
                    ->as_array();
        return $orders;
    } 
}
